<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    * {
      margin: 0;
      padding: 0;
    }

    .box {
      width: 50vw;
      height: 50vh;
      background-color: pink;
    }

    /* 面试题：vw/vh/  rem区别 */

    .em {
      width: 10em;
      height: 10em;
      /* font-size: 12px; */
      background-color: green;
      /* em的大小取决于当前的font-size,如果自身没有font-size就会往上查找一直找到默认的font-size */
    }

    .rem {
      width: 10rem;
      height: 10rem;
      font-size: 12px;
      background-color: blue;
      /* rem跟html根元素的font-size有关 */
    }
  </style>
</head>

<body>
  <div class="box">
    我是盒子
  </div>


  <div class="rem">
    rem
  </div>
  <div class="em">
    em
  </div>
</body>

</html>